var log4js = require('log4js');
var configObj = require('./config.json');

//日志配置
log4js.configure({
    appenders: [
        { type: 'console' },
        { type: 'file',filename:configObj.debuglogfilename,maxLogSize:10240000,backups:3,category: 'debug'}, //byte
        { type: 'dateFile',filename:configObj.tracelogfilename,'pattern':'-yyyy-MM-dd',category: 'trace'},
        { type: 'file',filename:configObj.errorlogfilename,maxLogSize:102400000,backups:10,category: 'error'}

    ],
    replaceConsole : true
});

exports.debuglogger = log4js.getLogger('debug');
exports.tracelogger = log4js.getLogger('trace');
exports.errorlogger = log4js.getLogger('error');
